@use '../../_styles/mixin.scss' as *;

.o-dialog-responsive {
  @include respond-to('>phone') {
    --layer-origin: center;
  }
  @include respond-to('<=pad') {
    --layer-position: fixed;
    .o-dlg-btn {
      + .o-dlg-btn.o-btn-text {
        position: relative;
        &::before {
          content: '';
          border-left: 1px solid var(--o-color-control1-light);
          position: absolute;
          height: 24px;
          left: -8px;
        }
      }
    }
  }
  @include respond-to('phone') {
    --layer-align: flex-end;
    --layer-origin: center bottom;
    --dlg-min-width: none;
    .o-dlg-btn {
      flex: 1;
    }
    .o-dlg-btn-close {
      display: none;
    }
  }
}

.o-dialog {
  @include respond-to('laptop') {
    --dlg-edge-gap: 24px;
    --dlg-inner-gap: 16px;
  }
  @include respond-to('pad_h') {
    --dlg-edge-gap: 24px;
    --dlg-inner-gap: 16px;
  }
  @include respond-to('<=pad_v') {
    --dlg-edge-gap: 16px;
    --dlg-inner-gap: 12px;
  }
}

.o-dlg-header {
  @include respond-to('laptop') {
    font-size: var(--o-font_size-h4);
    line-height: var(--o-line_height-h4);
  }
  @include respond-to('<=pad') {
    font-size: var(--o-font_size-text2);
    line-height: var(--o-line_height-text2);
  }
}

.o-dialog-exlarge {
  @include respond-to('laptop') {
    --dlg-width: 80%;
    --dlg-max-height: 80%;
    --dlg-min-height: 65%;
  }
  @include respond-to('<=pad') {
    --dlg-width: 100%;
    --dlg-max-height: 100%;
    --dlg-radius: 0;
    --dlg-margin: 0;
    --dlg-edge-gap: 24px;
    --dlg-inner-gap: 16px;
  }
}
.o-dialog-large {
  @include respond-to('laptop') {
    --dlg-width: 65%;
    --dlg-max-height: 80%;
    --dlg-min-height: 50%;
  }

  @include respond-to('<=pad') {
    --dlg-width: 100%;
    --dlg-max-height: 100%;
    --dlg-radius: 0;
    --dlg-margin: 0;
    --dlg-edge-gap: 24px;
    --dlg-inner-gap: 16px;
  }
}
.o-dialog-medium {
  @include respond-to('laptop') {
    --dlg-width: 50%;
    --dlg-max-height: 80%;
    --dlg-min-height: 35%;
  }
  @include respond-to('pad_h') {
    --dlg-width: 65%;
    --dlg-max-height: 80%;
    --dlg-min-height: 128px;
    --dlg-margin: 24px;
  }
  @include respond-to('<=pad_v') {
    --dlg-width: calc(100vw - 48px);
    --dlg-max-height: 65%;
    --dlg-min-height: 128px;
    --dlg-margin: 24px;
  }
}
.o-dialog-small {
  @include respond-to('laptop') {
    --dlg-width: 35%;
    --dlg-max-height: 50%;
    --dlg-min-height: 20%;
  }
  @include respond-to('<=pad') {
    --dlg-min-height: 128px;
    --dlg-max-height: 80%;

    --dlg-margin: 24px;

    --dlg-edge-gap: 16px;
    --dlg-inner-gap: 12px;
    --dlg-header-gap: 12px;
  }
  @include respond-to('pad_h') {
    --dlg-width: 50%;
  }
  @include respond-to('pad_v') {
    --dlg-width: 65%;
  }
  @include respond-to('phone') {
    --dlg-width: calc(100vw - 48px);
    --dlg-max-height: 65%;
  }
}

.o-dialog-phone-half-full {
  @include respond-to('phone') {
    --dlg-width: 100%;
    --dlg-margin: 0;
    &.o-dialog-auto,
    &.o-dialog-small,
    &.o-dialog-medium {
      --dlg-radius: var(--o-radius_control-l) var(--o-radius_control-l) 0 0;
    }
  }
}
